﻿using System;
using System.Collections.Generic;
using System.Text;
using EnvDTE;
using EnvDTE80;

namespace TSVNAddin.Core
{
	public class ActiveDocumentAdapter
	{
		private readonly DTE2 _Dte;

		public ActiveDocumentAdapter(DTE2 dte)
		{
			_Dte = dte;
		}

		public virtual string GetFileName()
		{
			return _Dte.ActiveWindow.Document.FullName;
		}

		public virtual bool IsVersionable()
		{
			if (_Dte.ActiveWindow == null)
				return false;

			if (_Dte.ActiveWindow.Document == null)
				return false;

			return true;
		}
	}
}
